package com.ytjj.qmyx.admin.controller.circle;

import com.ytjj.common.api.CommonResult;
import com.ytjj.qmyx.users.client.CircleClient;
import com.ytjj.qmyx.users.model.circle.CircleMainRoleApplyQueryRequest;
import com.ytjj.qmyx.users.model.circle.CircleMainRoleCheckRequest;
import com.ytjj.qmyx.users.model.circle.CircleMainRoleOrderListRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 团小圈团主-申请、审批
 */
@Slf4j
@RestController
@RequestMapping("/circleMainRole")
public class CircleMainRoleInfoController {
    @Autowired
    private CircleClient circleClient;
    /**
     * 申请列表
     * @return
     */
    @PostMapping("/applyList")
    public CommonResult getAllApplyList(@RequestBody CircleMainRoleApplyQueryRequest request) {
        return circleClient.getAllApplyList(request);
    }

    /**
     * 团长列表
     * @param request
     * @return
     */
    @PostMapping("/mainList")
    public CommonResult getMainList(@RequestBody CircleMainRoleApplyQueryRequest request) {
        return circleClient.getMainList(request);
    }

    /**
     * 团长订单列表
     * @return
     */
    @PostMapping("/orderList")
    public CommonResult queryOrderList(@RequestBody CircleMainRoleOrderListRequest request) {
        return circleClient.queryOrderList(request);
    }

    /**
     * 团长状态变更
     * @param request
     * @return
     */
    @PostMapping("/check")
    public CommonResult check(@Validated @RequestBody CircleMainRoleCheckRequest request) {
        return circleClient.check(request);
    }

}
